<?php
    $Sector = Dracosys::getSessionValue(SESSION_INTERFACE, 'SectorEdit');
    $ArDepartaments = Dracosys::getSessionValue(SESSION_INTERFACE, 'DepartamentList');
?>
<h2>Editar Setor</h2>
<section id="EditSector">
    <form method="post" action="Setor/atualizar" name="FormEditarSetor">
        <section id="EditSector_Dados" class="section-update">
            <div class="out_txt big"><label for="EditSector_IDDepartamento">Departamento</label></div>
            <div class="inp_txt big">
                <select name="IDDepartamento" id="EditSector_IDDepartamento">
                    <?php foreach($ArDepartaments as $Departament):
                            $StSelected = $Sector->getDepartamento()->equals($Departament) ? 'selected="selected"' : '';
                    ?>
                        <option value="<?=$Departament->getIDDepartamento()?>" <?=$StSelected?> ><?=$Departament->getStNome()?></option>
                    <?php endforeach; ?>
                </select>
            </div>
            <div class="out_txt big"><label for="EditSector_StSetor">Nome do Setor</label></div>
            <div class="inp_txt big"><input type="text" name="StSetor" id="EditSector_StSetor" value="<?=$Sector->getStNome()?>" /></div>
        </section>
        <input type="hidden" name="IDSetor" id="EditSector_IDSetor" value="<?=$Sector->getIDSetor()?>" />
        <div class="btn"><button class="v1">Atualizar</button></div>
    </form>
</section>
